from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
import os
import math

def generate_launch_description():
    ballistic_solver_pkg = get_package_share_directory('ballistic_solver')
    
    # 弹道解算节点（完全遵循范例Node配置格式）
    ballistic_solver_node = Node(
        package='ballistic_solver',          
        executable='ballistic_solver_node',  
        name='ballistic_solver_node',        
        output='screen',                     
        parameters=[                         # 加载YAML参数文件
            os.path.join(ballistic_solver_pkg, 'config', 'ballistic_solver_params.yaml')
        ],
        arguments=['--ros-args', '--log-level', 'info']
    )
    
    # 创建launch描述
    return LaunchDescription([
        ballistic_solver_node
    ])